package com.tsky.yyj.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.opensymphony.xwork2.ActionSupport;
import com.tsky.common.ActionUtil;
import com.tsky.common.RandomValidateCode;

public class ValidateCodeAction  extends ActionSupport {

	
	@Override
	public String execute() throws Exception {
		HttpServletRequest request = ActionUtil.getRequest();
		HttpServletResponse  response = ActionUtil.getResponse();
		
		response.setContentType("image/jpeg");//设置相应类型,告诉浏览器输出的内容为图片
        response.setHeader("Pragma", "No-cache");//设置响应头信息，告诉浏览器不要缓存此内容
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expire", 0);
        RandomValidateCode randomValidateCode = new RandomValidateCode();
        
        randomValidateCode.getRandcode(request, response);
        
        return null;
	}
}
